Many of today's digital video devices (e.g. digital cameras, digital video recorders, etc.) employ a mosaicing/demosaicing process to capture and to reproduce a color image. In the mosaicing process, a color image is captured using a color filter array (CFA) and an array of optical sensors that is overlaid by the CFA. The CFA has a plurality of filter elements, each of which overlays one of the optical sensors in the optical sensor array, and each filter element is designed to pass only one color of light. The most common type of CFA is the Bayer pattern filter (also referred to as a Bayer filter), an example of which is shown in FIG. 1. The Bayer filter comprises filter elements that pass three different colors of light: green (G), blue (B), and red (R). These filter elements are arranged in alternating rows of green-blue and red-green. With this pattern, red and blue filter elements appear on every other row and every other column, while green filter elements appear on every row and every column. This pattern exploits the human eye's higher sensitivity to green light.
As noted, each filter element passes light of only one color. Thus, in the Bayer filter of FIG. 1, filter element G1 passes only green light, filter element B2 passes only blue light, and filter element R9 passes only red light. This means that the optical sensor behind filter element G1 senses only the green portion of the light that hits filter element G1, the optical sensor behind filter element B2 senses only the blue portion of the light that hits filter element B2, and the optical sensor behind filter element R6 senses only the red portion of the light that hits filter element R9. Thus, because of the Bayer filter, the output of each optical sensor will provide information on only one of the three colors.
After capturing an image through the Bayer filter, the array of optical sensors outputs a plurality of values. Each value comes from one of the optical sensors, and each value corresponds to a particular pixel of the image (each optical sensor represents a pixel). Since each pixel corresponds to one of the optical sensors, and since each optical sensor corresponds to one of the filter elements of the Bayer filter, each pixel in turn corresponds to one of the filter elements of the Bayer filter. Thus, using the example of FIG. 1, pixel 1 corresponds to filter element G1, pixel 2 corresponds to filter element B2, pixel 64 corresponds to filter element G64, and so on.
For each pixel, only one of the three color values is provided by the optical sensor array. This color value will be referred to herein as the sensed color value. In the example of FIG. 1, the color value provided by the optical sensor array for pixel 1 is the green color value. Thus, green is the sensed color value for pixel 1; hence, pixel 1 is referred to as a green pixel. Similarly, the sensed color value for pixel 2 is blue; thus, pixel 2 is referred to as a blue pixel.
In order to render a pixel in full color, a color value is needed for all three colors. Since only one sensed color value is provided by the sensor array for each pixel, the other two color values need to be calculated for each pixel, which means that for each pixel, there is one sensed color value and two calculated color values. Deriving the two calculated color values for each pixel is the purpose of the demosaicing process.
Often, a color value for a pixel is calculated by way of linear approximation using the sensed color values of neighboring pixels. For example, to determine the blue color value for red pixel R29 of FIG. 1, linear approximation may be carried out using the sensed blue color values of neighboring blue pixels B20, B22, B36, and B38. Similarly, to determine the green color value for red pixel R29, linear approximation may be performed using the sensed green color values of neighboring green pixels G21, G28, G30, and G37.
The linear approximation technique is based on the assumption that a pixel should have a calculated color value that is close to the corresponding sensed color values of neighboring pixels. This assumption holds true for most portions of an image; however, for certain areas, it begins to break down. One area in which this assumption breaks down is at an edge area in which there is exhibited some chromatic aberration. As used herein, the term edge area refers to an area of transition in an image in which there is a sharp change or discontinuity in image color or brightness. This may occur, for example, in an area of an image in which there is a transition from one object to another (e.g. the edge between a person's body in the foreground and a house in the background). Chromatic aberration refers to spurious colors that are caused by imperfections in one or more lenses that are used to focus an image onto the CFA. Chromatic aberration is most often manifested near edge areas; thus, in such edge areas, the lens(es) cause(s) spurious colors to be directed at some of the optical sensors, which in turn cause the optical sensors to sense certain colors that do not accurately reflect the actual colors of the image being captured.
It has been observed that if linear approximation is applied to an edge area in which there is chromatic aberration, it leads to the generation of erroneous and illogical color values. Such aberrant color values can lead to undesirable effects in the demosaiced image such as purpling, fringing, etc., which exacerbate the chromatic aberration that is already present in the edge area. Because of this, it is not desirable to use linear approximation in such circumstances. An improved demosaicing technique is thus needed to address this and other scenarios.